using System;
using System.Collections.Generic;
using System.Text;
using SQLGen;
using Microsoft.FSharp.Core;

namespace SQLGenerationTest
{
    class TestDelete
    {
        /*
         * To build out:
		    * Delete From * Where
         */

        public static bool PerformTest()
        {
            string sql = "";
            RunTest[] tests = { SimpleDelete };
            foreach (RunTest test in tests)
            {
                sql = test();
                Console.WriteLine(sql + "\n");
                Log.Write(sql + "\n");
            }

            return true;
        }

        static string SimpleDelete()
        {
            Statement stmt = Statement.Delete(
                From.TableName("mytable"),
                Where.SubQueryIn(new Rel(Table.Name("mytable"), "joinfield", Table.Name("anothertable"), "joinfield"), Where.All));

            return SqlModel.emitStatementSql(stmt);
        }
    }
}
